/* SPDX-License-Identifier: GPL-2.0 */

#ifndef DIM_ADAPTER_H
#define DIM_ADAPTER_H

/* list supported extend type, and it should be defined by power of 2,
then it can be used as A|B|C, and extend to A, B and C at the same time */
#define DIM_EXTEND_TYPE_BASE            1UL
/* depends on tpm 2.0 device */
#define DIM_EXTEND_TYPE_TPM2            (DIM_EXTEND_TYPE_BASE)
/* not supported now, reserved */
#define DIM_EXTEND_TYPE_TEE             (DIM_EXTEND_TYPE_BASE << 1)
/* not supported now, reserved */
#define DIM_EXTEND_TYPE_1630_HSM        (DIM_EXTEND_TYPE_BASE << 2)

unsigned long dim_set_extend_type(unsigned long extend_type);

void dim_reset_extend_type(void);

int dim_extend(char *digest, int len);

int dim_get_extend_flag(void);

#endif /* DIM_ADAPTER_H */
